﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SDMX_Common = SDMX_ML.Framework.Common;

namespace SDMX_ML.Framework.Structure
{
    /// <summary>
    /// CategorySchemeType.
    /// </summary>
    public class CategorySchemeType
    {
        
        private List<SDMX_Common.TextType> _name;
        private List<SDMX_Common.TextType> _description;
        private List<CategoryType> _category;
        private SDMX_Common.AnnotationsType _annotations;
        private SDMX_Common.IDType _id;
        private SDMX_Common.IDType _agencyID;
        private string _version;
        private string _urn;
        private string _uri;
        private bool? _isExternalReference;
        private bool? _isFinal;
        private string _validFrom;
        private string _validTo;

        public CategorySchemeType(SDMX_Common.TextType name, SDMX_Common.IDType id, SDMX_Common.IDType agencyID)
        {
            if (name != null & id != null & agencyID != null)
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();
                _category = new List<CategoryType>();

                _name.Add(name);
                _id = id;
                _agencyID = agencyID;
            }
            else
            {
                throw new Exception("Element Name and attributes id and AGencyID in CategorySchemeType are required.");
            }

        }

        //Elements

        /// <summary>
        /// Name.
        /// </summary>
        public List<SDMX_Common.TextType> Name
        {
            get { return _name; }
            set { _name = value; }
        }
        
        /// <summary>
        /// Description.
        /// </summary>
        public List<SDMX_Common.TextType> Description
        {
            get { return _description; }
            set { _description = value; }
        }
        
        /// <summary>
        /// Category.
        /// </summary>
        public List<CategoryType> Category
        {
            get { return _category; }
            set { _category = value; }
        }
        
        /// <summary>
        /// Annotations.
        /// </summary>
        public SDMX_Common.AnnotationsType Annotations
        {
            get { return _annotations; }
            set { _annotations = value; }
        }

        //Attributes
       /// <summary>
       /// ID.
       /// </summary>
        public SDMX_Common.IDType ID
        {
            get { return _id; }
            set { _id = value; }
        }
        
        /// <summary>
        /// AgencyID.
        /// </summary>
        public SDMX_Common.IDType AgencyID
        {
            get { return _agencyID; }
            set { _agencyID = value; }
        }
        
        /// <summary>
        /// Version.
        /// </summary>
        public string Version
        {
            get { return _version; }
            set { _version = value; }
        }
        
        /// <summary>
        /// URN.
        /// </summary>
        public string URN
        {
            get { return _urn; }
            set { _urn = value; }
        }
        
        /// <summary>
        /// URI.
        /// </summary>
        public string URI
        {
            get { return _uri; }
            set { _uri = value; }
        }
        
        /// <summary>
        /// IsExternalReference.
        /// </summary>
        public bool? IsExternalReference
        {
            get { return _isExternalReference; }
            set { _isExternalReference = value; }
        }
        
        /// <summary>
        /// IsFinal.
        /// </summary>
        public bool? IsFinal
        {
            get { return _isFinal; }
            set { _isFinal = value; }
        }
        
        /// <summary>
        /// ValidFrom
        /// </summary>
        public string ValidFrom
        {
            get { return _validFrom; }
            set { _validFrom = value; }
        }
        
        /// <summary>
        /// ValidTo.
        /// </summary>
        public string ValidTo
        {
            get { return _validTo; }
            set { _validTo = value; }
        }
    }
}
